<?php
class Dmf_Exception_Error
{
    private $_info = array();
    
    public function __construct( $errorinfo )
    {
        $this->_info = $errorinfo;
    }
    
    public function getCode()
    {
        return $this->_info['code'];
    }
    
    public function getMessage()
    {
        switch( $this->_info['code'] )
        {
            case E_WARNING:
                $error = 'Warning error';
                break;
            case E_ERROR:
                $error = 'Fatal error';
                break;
            case E_NOTICE:
                $error = 'Notice error';
                break;
            case E_DEPRECATED:
                $error = 'Deprecated error';
                break;
            default:
                $error = 'Unkown error';
                break;
        }
        
        return '<b>' . $error . ':</b> ' . $this->_info['message'];
    }
    
    public function getLine()
    {
        return $this->_info['line'];
    }
    
    public function getTrace()
    {
        return debug_backtrace();
    }
    
    public function getFile()
    {
        return $this->_info['file'];
    }
}